/*
  This software is copyright 2009 Matthew Wilson matthew@wilson.org
  and available under the Artistic License 2 ("AL2") as documented at
  http://jsmeta.googlecode.com
*/

var callTree, treeRoot;
$(function() {
  $("#callTrace").dynatree({
    
  });
  callTree = $("#callTrace").dynatree("getTree");
  treeRoot = $("#callTrace").dynatree("getRoot");
});

function callTraceNodeAdd(nodeId, parentNodeId, nodeTitle) {
  (parentNodeId!==null ? callTree.getNodeByKey('act_' + parentNodeId) : treeRoot).append({
    key: 'act_'+nodeId,
    title: 'actId: ' + nodeId + ' rule: ' + nodeTitle,
    isFolder: true,
    expand: true
  });
}
function callTraceNodeStatus(nodeId, nodeStatus) {
  callTree.getNodeByKey('act_' + nodeId).append({
    title: nodeStatus,
    isFolder: false
  });
}
function callTraceNewInput(inputStr) {
  treeRoot.append({
    title: '<strong>----------------------------------------------------------------------------------New Input String: ' + inputStr + '</strong>',
    isFolder: false
  });
}
